<?php defined('_JEXEC') or die('Restricted access');
// Initialize variables
$db		=& JFactory::getDBO();
$user	=& JFactory::getUser();
$config	=& JFactory::getConfig();
$now	=& JFactory::getDate();

$config 		= &JComponentHelper::getParams('com_feed_manager');
$data_type 		= $config->get('data_type');

JHTML::_('behavior.tooltip');
?>
<form action="index.php?option=<?php echo $option; ?>" method="post" name="adminForm">
	<table>
		<tr>
			<td align="left" width="100%">
				<?php echo JText::_( 'Filter' ); ?>:
				<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
				<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
			</td>
			<td nowrap="nowrap">
			
			</td>
		</tr>
	</table>
	<table class="adminlist">
		<thead>
			<tr>
				<th width="1%">		<?php echo JText::_( 'Num' ); ?>	</th>
				<th width="1%" class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->rows); ?>);" /></th>
				<th class="title" width="46%"><?php echo JHTML::_('grid.sort',   'Ttitle', 'CR.title', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
				<th width="10%" nowrap="nowrap"><?php echo JHTML::_('grid.sort',   'Source URL', 'CR.SourceURL', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>				
				<th width="20%" nowrap="nowrap"><?php echo JHTML::_('grid.sort',   'date original 	', 'CR.date_original 	', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>			
				<th width="15%" nowrap="nowrap"><?php echo JHTML::_('grid.sort',   'feed', 'CR.fid', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>			
				<th width="15%" nowrap="nowrap"><?php echo JHTML::_('grid.sort',   'hits', 'CR.hits', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>			
				<th width="2%" nowrap="nowrap"><?php echo JHTML::_('grid.sort',   'ID', 'CR.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
			</tr>
		</thead>
		<tfoot>
			<tr>	<td colspan="8">	<?php echo $this->pageNav->getListFooter(); ?></td></tr>
		</tfoot>
		<tbody>
		<?php
		$k = 0;
		$nullDate = $db->getNullDate();	
		for ($i=0, $n=count($this->rows); $i < $n; $i++) {
			$row = $this->rows[$i];
			$link	=	'';
			$class	=	'';
		
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td>	<?php echo $this->pageNav->getRowOffset( $i ); ?>	</td>
				<td>	<input type="checkbox" id="cb<?php echo $i; ?>" name="cid[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" />	</td>
				<td>
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Article' );?>::<?php echo $row->title; ?>">				
						<?php
						if ($row->state)
						{
							$link 		= 'index.php?option='.$option.'&task=content.edit&cid[]='. $row->cid ;							
							?>
							<!--<a href="<?php echo $link; ?>"><?php echo $row->title; ?></a> 
							-->
							<span style="color:#0B55C4;"><?php echo $row->title; ?></span>
							<?php
						}else {
							echo $row->title;
						}
						
						?>
						
					</span>						
				</td>	
				<td align="center">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Link Receive' );?>::<?php echo $row->SourceURL; ?>">				
					<a href="<?php echo $row->SourceURL; ?>" target="_blank"><img src="components/com_feed_manager/assets/images/url.png" /></a></span>						
				</td>	
				<td align="center"><?php echo JHTML::_('date', $row->date_original, JText::_('DATE_FORMAT_LC2'));; ?></td>
				<td align="center"><?php echo $row->fid; ?></td>
				<td align="center"><?php echo $row->hits; ?></td>		
				<td align="center">	<?php echo $row->cid; ?>	</td>
			</tr>
			<?php
			$k = 1 - $k;
		}
		?>
		</tbody>
	</table>
	<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
	<input type="hidden" name="task" value="contents" />
	<input type="hidden" name="controller" value="content" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
